/**
 * 功能描述 行编辑触发事件
 */
define(function (require, exports, module) {
	var store = require("store");
	var activeUser = store.get("user");
    module.exports = {
        setTotal : function(component, widget){
        	var datas = component.getData();
        	var price = 0;
        	for (var i = 0;i<datas.length;i++){
        		price = price + Number(datas[i].price);
        	}
        	widget.get("form").setValue("totalAmount", price.toFixed(2));
        },
        fillingData : function(rowData, component){
        	rowData.operatorName = activeUser.name;
        	rowData.operator = activeUser.pkUser;
        	rowData.chargeDate = moment(new Date());
        	component.update(index, rowData);
        },
    };
});
